<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>basket.js - a simple script loader that caches scripts with localStorage</title>
		<link rel="stylesheet" href="asset/base.css">
	</head>
	<body>
		<div id="container">
			{% include header.html %}
			<div class="content">
				{{ content | markdownify }}
			</div>
		</div>
		<script type="text/template" id="intro">
			<p><em>This section was rendered using the micro-templating in Underscore.js. It's just one of a number of scripts that were added to this document using basket.js when you loaded it and should now be <strong>cached</strong> in localStorage (if supported). If you visit this page again, the scripts will be loaded from there rather than being refetched. Backbone.js was also loaded and we created a new model with the name: <%= name %> (just for funsies).</em></p>
		</script>
		<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
		<script src="https://cdn.rawgit.com/components/rsvp.js/3.0.8/rsvp.min.js"></script>
		<script src="dist/basket.min.js"></script>
		<script>
			basket
				.require({ url: 'test/fixtures/jquery.min.js' })
				.then(function () {
					basket
						.require(
							{ url: 'test/fixtures/underscore-min.js' },
							{ url: 'test/fixtures/backbone-min.js' }
						)
						.then(function () {
							var testModel = Backbone.Model.extend({
								idAttribute: '_id'
							});
							var myModel = new testModel({ _id: 4, name: 'Nyan Cat' });
							var message = $('#message');
							var templateContent = $('#intro').html();
							var compiled = _.template(templateContent);
							message.html(compiled({ name: myModel.get('name') }));
					});
				});
		</script>
		<a href="http://github.com/addyosmani/basket.js"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
	</body>
</html>
